package com.springboot.wisdom.log.domain.vo;

import com.springboot.wisdom.common.common.constant.LogStatusEnum;
import com.springboot.wisdom.log.domain.entity.LogDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.validation.annotation.Validated;

/**
 * @Description
 * @Author LY L
 * @Date 2024-12-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@AllArgsConstructor
@Validated
public class LogVO extends LogDO {

    // 用于日志记录。
    public LogVO(String userId, LogStatusEnum operationType, String details, String ipAddress) {
        super.setUserId(userId);
        super.setOperationType(operationType.getValue());
        super.setDetails(details);
        super.setIpAddress(ipAddress);
    }

    // 用于日志记录。
    public LogVO(LogStatusEnum operationType, String details, String ipAddress) {
        super.setOperationType(operationType.getValue());
        super.setDetails(details);
        super.setIpAddress(ipAddress);
    }

}
